<!--车辆管理页-->
<template>
  <div style="height: 6vh;background-color:#fff;padding:10px 20px;">
    <span style="line-height:60px;font-size:20px;">订单管理</span>
<!--    <el-button @click=""-->
<!--               type="primary" style="float:right;margin-top:13px;">-->
<!--      新建车辆</el-button>-->
  </div>
  <!-- 新增车辆弹窗 -->
  <el-dialog  style="width:1000px;padding:40px;"
             >
    <el-form label-width="80px" label-position="top">
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="车辆品牌">
            <el-input placeholder="请输入内容" ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆牌号">
            <el-input placeholder="请输入内容" ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="车辆型号">
            <el-input placeholder="请输入内容" ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆识别码">
            <el-input placeholder="请输入内容" ></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="车辆排量">
            <el-select placeholder="请选择" >
              <el-option label="1.6" value="1"></el-option>
              <el-option label="2.5" value="2"></el-option>
              <el-option label="4" value="3"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="车辆类型">
            <el-select placeholder="请选择" >
              <el-option ></el-option>
              <!--              <el-option label="轿车" value="10"></el-option>-->
              <!--              <el-option label="货车" value="20"></el-option>-->
              <!--              <el-option label="客车" value="30"></el-option>-->
              <!--              <el-option label="挂车" value="40"></el-option>-->
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="车身颜色">
            <el-select placeholder="请选择">
              <el-option label="黑" value="10"></el-option>
              <el-option label="白" value="20"></el-option>
              <el-option label="蓝" value="30"></el-option>
              <el-option label="灰" value="40"></el-option>
              <el-option label="银" value="50"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="里程数">
            <el-input placeholder="请输入内容"></el-input>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="购买时间">
            <el-date-picker type="date"
                            format="YYYY-MM-DD" value-format="YYYY-MM-DD"
                            @change=""/>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="上牌时间">
            <el-date-picker type="date"
                            format="YYYY-MM-DD" value-format="YYYY-MM-DD"
                            @change=""/>
          </el-form-item>
        </el-col>
      </el-row>
      <el-row :gutter="30">
        <el-col :span="12">
          <el-form-item label="购买价格">
            <el-input placeholder="请输入内容" ></el-input>
          </el-form-item>
        </el-col>
        <el-col :span="12">
          <el-form-item label="电池类型">
            <el-select placeholder="请选择" >
              <el-option label="铅酸蓄电池" value="10"></el-option>
              <el-option label="镍氢电池" value="20"></el-option>
              <el-option label="钠硫电池" value="30"></el-option>
              <el-option label="二次锂电池" value="40"></el-option>
              <el-option label="空气电池" value="50"></el-option>
              <el-option label="三元锂电池" value="60"></el-option>
              <el-option label="碱性燃料电池" value="70"></el-option>
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>
    </el-form>
    <template #footer>
      <el-button @click="">取消</el-button>
      <el-button type="primary" @click="">确定</el-button>
    </template>
  </el-dialog>
  <!-- 车辆搜索卡片 -->
  <el-card style="margin:20px;height: 70px;">
    <el-form :inline="true">
      <el-form-item label="设计师转单状态">
        <el-input placeholder="请输入内容" style="width:220px;" ></el-input>
      </el-form-item>
      <el-form-item label="设计师转单进度" style="width:290px;">
        <el-input placeholder="请输入内容" style="width:220px;" ></el-input>
      </el-form-item>
      <el-form-item label="查询订单编号" style="width:290px;">
        <el-input placeholder="请输入内容" style="width:220px;" ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button @click="">重置</el-button>
        <el-button type="primary" @click="">查询</el-button>
      </el-form-item>
    </el-form>
  </el-card>
  <!-- 车辆列表 -->
  <el-card style="margin:20px;">
    <el-table :data="ordersArr">
      <el-table-column prop="orderNumber" label="订单编号" width="80" align="center"/>
      <el-table-column prop="orderDate" label="订单日期" width="80" align="center"/>
      <el-table-column prop="clientname" label="客户姓名" align="center"/>
      <el-table-column prop="housesname" label="楼盘名称" align="center"/>
      <el-table-column prop="detailAddress" label="楼盘地址" align="center"/>
      <el-table-column prop="clientType" label="客户类型" align="center"
                       />
      <el-table-column prop="clientStatus" label="客户状态" align="center"/>
      <el-table-column prop="designer" label="设计师" align="center"/>
      <el-table-column prop="name" label="客户经理" align="center"/>
      <el-table-column prop="transferProgress" label="转单进度(阶段)" align="center"
                       />
      <el-table-column label="操作" align="center">
        <template #default="scope">
          <el-button link type="primary" size="small"
                     @click="">查看</el-button>
          <el-button link type="primary" size="small"
                     @click="">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
  </el-card>
</template>
<script setup>
import {onMounted, ref} from "vue";
import qs from "qs";
import axios from "axios";
import {ElMessage} from "element-plus";
const ordersList = ref({
  orderNumber: "20220101000001",
  orderDate: "2022-01-01",
  clientname: "张三",
  housesname: "楼盘名称",
  detailAddress: "楼盘地址",
  clientType: "个人客户",
  clientStatus: "已下单",
  designer: "设计师",
  name: "客户经理",
  transferProgress: "已转单"}
);
const ordersArr = ref([
  ordersList.value,
  ordersList.value
]);
const orderLoad = () => {
  axios.get(BASE_URL+'/crm/orders/load').then((response)=>{
    if(response.data.code==2000){
      ordersArr.value = response.data.data;
    }else{
      ElMessage.error(response.data.message);
    }
  })
  console.log(ordersArr.value);
}
onMounted(() => {
  orderLoad();
});
</script>